package java67_adv1;

public class SbTest {

	public static void main(String[] args) {

		// String的可变版本
		StringBuilder sb = new StringBuilder();
		sb.append(false);
		sb.append("we love java");
		sb.append(Math.PI);
		sb.append(new char[] { 'a', 'b', '刘' });
		System.out.println(sb);
		// 删除,替换,在中间添加
		sb.delete(4, 19);
		System.out.println(sb);
		sb.replace(2, 5, "5.25,我们来相会");
		System.out.println(sb);
		// 6个byte,6个char?
		sb.insert(6, "我会弹你脑门,戴头盔没用,练一下铁头功");
		System.out.println(sb);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>");
		StringBuilder s2 = new StringBuilder("我会弹你脑门,戴头盔没用,练一下铁头功");
		s2.replace(2, 5, "敲你头");
		System.out.println(s2);
		String s4 = s2.toString();
		s2.reverse();
		System.out.println(s2);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>");
		// abs,sin,cos,PI,E,pow(幂),max,min
		System.out.println(Math.E);
		System.out.println(Math.pow(5, 4));

		System.out.println(Math.min(12, Math.PI));
		System.out.println(Math.sin(30 / (180 / Math.PI)));
		System.out.println(">>>>>>>>>>>>");
		// ceil(大于某个数的最小整数),floor:小于某个数的最大整数
		System.out.println(Math.floor(11.5));// 11
		System.out.println(Math.floor(-11.5));// -12
		System.out.println(Math.ceil(11.5));// 12
		System.out.println(Math.ceil(-11.5));// -11
	}

}
